import { IFeidaoAiMobile } from '@dfeidao/atom-mobile/interfaces';
import get_storage from '@dfeidao/atom-mobile/storage/get';
import set_storage from '@dfeidao/atom-mobile/storage/set';
import uuid from 'uuid';
import get from '../atom/get';
import go_back from '../atom/go-back';

interface Iarr {
	id: string;
	text: string;
	show: boolean;
}
export default async function a003(fd: IFeidaoAiMobile) {
	const arr: Iarr[] = JSON.parse(await get_storage('arr') || '[]');
	arr.push({
		id: uuid(),
		text: get(fd, 'describe'),
		show: false
	});
	set_storage('arr', JSON.stringify(arr));
	go_back(fd);
}
